package com.yuexunit.mobilenurse.module.BloodManage.model.impl;

import com.yuexunit.mobilenurse.module.BloodManage.Api.BloodApplyApi;
import com.yuexunit.mobilenurse.module.BloodManage.bean.CheckDataBean;
import com.yuexunit.mobilenurse.module.BloodManage.model.IReceiveModel;
import com.yuexunit.mobilenurse.util.ApiUtil;
import com.yuexunit.mobilenurse.util.ProUtil;

import org.slf4j.Logger;

import java.util.Map;

import rx.Observable;

/**
 * Created by work-jx on 2017/10/25.
 */
public class ReceiveModel implements IReceiveModel{
    private BloodApplyApi api;

    //记录Log
    private final Logger log = ProUtil.getLogger(CheckModel.class);

    public BloodApplyApi ApiInstance() {
        if (api != null) {
            return api;
        } else {
            return ApiUtil.getInstance().createRetrofitApi_BloodManage(BloodApplyApi.class);
        }
    }


    @Override
    public Observable<CheckDataBean> receiveBlood(Map<String, String> praise) {
        api = ApiInstance();
        return api.receiveBloodBag(praise);
    }
}
